cmake_minimum_required(VERSION 3.16)
project(MathLibrary VERSION 1.0 LANGUAGES CXX)

set(CMAKE_AUTOMOC ON)  # For Qt's meta-object compiler
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt6 REQUIRED COMPONENTS Core)  # Or Qt5 if you're using that

# Define source files
set(SOURCES
    MathLibrary.cpp
)

set(HEADERS
    MathLibrary.h
)

# Create the shared library
add_library(MathLibrary SHARED ${SOURCES} ${HEADERS})

# Define the export macro for the library
target_compile_definitions(MathLibrary PRIVATE MATHLIBRARY_EXPORTS)

# Link Qt libraries
target_link_libraries(MathLibrary PRIVATE Qt6::Core)  # Or Qt5::Core

# Set include directories
target_include_directories(MathLibrary
    PUBLIC
        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
        $<INSTALL_INTERFACE:include>
)

# Installation rules (optional)
# install(TARGETS MathLibrary
#     LIBRARY DESTINATION lib
#     ARCHIVE DESTINATION lib
#     RUNTIME DESTINATION bin
#     INCLUDES DESTINATION include
# )
